<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>学生数据管理</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>学生数据列表</h1>
<table id="studentsTable">
  <thead>
    <tr>
      <th>ID</th>
      <th>姓名</th>
      <th>年龄</th>
      <th>专业</th>
      <th>年级</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>
    <!-- 学生数据将通过JavaScript动态插入这里 -->
  </tbody>
</table>
<form id="addStudentForm">
  <input type="text" id="name" placeholder="姓名" required>
  <input type="number" id="age" placeholder="年龄" required>
  <input type="text" id="major" placeholder="专业" required>
  <input type="text" id="grade" placeholder="年级" required>
  <button type="submit">添加学生</button>
</form>
<form id="editStudentForm" style="display:none;">
  <input type="hidden" id="editId">
  <input type="text" id="editName" placeholder="姓名" required>
  <input type="number" id="editAge" placeholder="年龄" required>
  <input type="text" id="editMajor" placeholder="专业" required>
  <input type="text" id="editGrade" placeholder="年级" required>
  <button type="submit">保存修改</button>
</form>
<script src="script.js"></script>
</body>
</html>